﻿/*
TreeGridModule is a liteGrid plug-in that zebra-stripes the rows of the grid.

Author: MBH
DateAuthored: 7/11/09  
*/

//This module zerbra-sripes the rows of the table.
function StripifyModule() {
	var base = this;

	//Registers for events that signal that the table needs to be 
	//re-stripified.
	base.initialize = function(liteGrid, options) {

		//Register for the events we care about.
		liteGrid.$el.bind("tableUpdated", function(event, table) {

			//Remove even/odd classes from everything
			table.$el.find("tbody tr").removeClass("even odd");

			table.$el.find("tbody tr:visible:even").addClass("even");
			table.$el.find("tbody tr:visible:odd").addClass("odd");
		});
	}
}
